package com.example.demo.listener;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.ApplicationListener;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.stereotype.Component;


@Component
@EnableScheduling
@ConditionalOnProperty(name = "myFilter", havingValue = "true")
public class MyListener implements ApplicationListener<MyEvent> {


    @Override
    public void onApplicationEvent(MyEvent myEvent) {

        System.out.println(myEvent.getOrder().toString());
    }
}
